aboutsummaryrefslogtreecommitdiff
path: root/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.tes...
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-12-16 22:14:06 +0000
committerMichael Williamson <mike@zwobble.org>2023-12-16 22:15:34 +0000
commit660f8ae4a3869129ed0a35b83a8a87ef2c042fdf (patch)
tree68e61527726508d3feba1edc38febe32ab568182 /snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
parentc8dd5dc5b3c11bf1822c960a8ad1e7260957b3f9 (diff)
Garbage collect on function exit
Diffstat (limited to 'snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected')
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected30
1 files changed, 29 insertions, 1 deletions
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index f764af61..040ae764 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -13,12 +13,37 @@ Compilation unit elements:
return-type=void
)
(
+ function-decl
+ "shed__runtime__gc_get_root_stack_index"
+ params=()
+ return-type=int
+)
+(
+ function-decl
+ "shed__runtime__gc_set_root_stack_index"
+ params=((param "gc_root_stack_index" int))
+ return-type=void
+)
+(
+ function-decl
+ "shed__runtime__gc_push_root"
+ params=((param "gc_root" int))
+ return-type=void
+)
+(
+ function-decl
+ "shed__runtime__gc_collect"
+ params=()
+ return-type=void
+)
+(
function
"shed__effectHandlerMethod__f__0"
visibility=private
- locals=((param "closurePointer__0" data-ptr) (val "effectHandler__0" data-ptr) (val "effectHandler__1" data-ptr) (val "tmp__0" int))
+ locals=((param "closurePointer__0" data-ptr) (val "gcRootStackIndex__0" int) (val "effectHandler__0" data-ptr) (val "effectHandler__1" data-ptr) (val "tmp__0" int))
return-type=int
body=(
+ (call (local "gcRootStackIndex__0") "shed__runtime__gc_get_root_stack_index" ())
(call (local "effectHandler__0") "shed__runtime__effects_get_handler" ())
(
memory-load
@@ -29,6 +54,9 @@ Compilation unit elements:
)
(call _ "shed__runtime__effects_set_handler" ((local "effectHandler__1")))
(local-store (local "tmp__0") (int 0))
+ (call _ "shed__runtime__gc_set_root_stack_index" ((local "gcRootStackIndex__0")))
+ (call _ "shed__runtime__gc_push_root" ((local "tmp__0")))
+ (call _ "shed__runtime__gc_collect" ())
(call _ "shed__runtime__effects_set_handler" ((local "effectHandler__0")))
(resume (local "tmp__0"))
)